// 定义数据模型
import mongoose from 'mongoose'
const Schema = mongoose.Schema
const Order = new Schema({
  id: { // 产品id
    type: String,
    require: true
  },
  user: { // 用户
    type: String,
    require: true
  },
  time: { // 创建时间
    type: String,
    require: true
  },
  total: { // 支付的金额
    type: Number,
    require: true
  },
  imgs: { // 商品图片
    type: Array,
    require: true
  },
  name: { // 商品名称
    type: String,
    require: true
  },
  status: { // 状态
    type: Number,
    require: true
  }
})

export default mongoose.model('Order', Order)
